﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
	<title>m-treeview dome</title>

	<link rel="stylesheet" type="text/css" href="http://crm.esunny.com/Css/global.css"/>
    <link rel="stylesheet" type="text/css" href="http://crm.esunny.com/Css/admin.css"/>
    <link rel="stylesheet" type="text/css" href="m-treeview.css"/>
	<script type="text/javascript" src="http://crm.esunny.com/Scripts/jquery.js"></script>
	<script type="text/javascript" src="m-treeview.source.js"></script>
</head>
<body>
	<p>m-treeview 1.0版 应用demo</p>
	<div>checkbox tree</div>
	<ul id="normalTree"></ul>
	<ul id="checkboxTree"></ul>
	<ul id="radioTree"></ul>
	<script type="text/javascript">
		 var data = [{id:'934cec74-5818-40ad-9c0b-cf7659936a76',pid:null,text:'系统管理员(administrators)',attr:{value:'934cec74-5818-40ad-9c0b-cf7659936a76',name:'txtAccountID',accountName:'系统管理员'}},{id:'7122801d-d14d-4a66-afd3-25d9c9661115',pid:'934cec74-5818-40ad-9c0b-cf7659936a76',text:'美美(阿拉蕾)',attr:{value:'7122801d-d14d-4a66-afd3-25d9c9661115',name:'txtAccountID',accountName:'美美'}},{id:'c4cc12aa-4da8-4dd0-86b3-3571f86c035f',pid:'934cec74-5818-40ad-9c0b-cf7659936a76',text:'一(1)',attr:{value:'c4cc12aa-4da8-4dd0-86b3-3571f86c035f',name:'txtAccountID',accountName:'一'}},{id:'6fd92f72-dbfb-4552-8e73-9abaa6c76e9d',pid:'934cec74-5818-40ad-9c0b-cf7659936a76',text:'袁锐(直销组长)',attr:{value:'6fd92f72-dbfb-4552-8e73-9abaa6c76e9d',name:'txtAccountID',accountName:'袁锐'}},{id:'b5987497-8560-4a0b-bb19-decb55b29058',pid:'6fd92f72-dbfb-4552-8e73-9abaa6c76e9d',text:'小强(直销专员)',attr:{value:'b5987497-8560-4a0b-bb19-decb55b29058',name:'txtAccountID',accountName:'小强'}},{id:'783ca418-c784-432a-9409-545d904fd9cc',pid:'934cec74-5818-40ad-9c0b-cf7659936a76',text:'小林(测试角色)',attr:{value:'783ca418-c784-432a-9409-545d904fd9cc',name:'txtAccountID',accountName:'小林'}},{id:'8b803160-c19a-499a-8be6-2b6940e34cad',pid:'934cec74-5818-40ad-9c0b-cf7659936a76',text:'小李(测试角色)',attr:{value:'8b803160-c19a-499a-8be6-2b6940e34cad',name:'txtAccountID',accountName:'小李'}},{id:'7d022f13-71a8-41b7-8700-52da15f10aff',pid:'934cec74-5818-40ad-9c0b-cf7659936a76',text:'阿斯多夫(测试角色)',attr:{value:'7d022f13-71a8-41b7-8700-52da15f10aff',name:'txtAccountID',accountName:'阿斯多夫'}},{id:'fa862fad-5eef-4236-81e7-14fca5a69e27',pid:'934cec74-5818-40ad-9c0b-cf7659936a76',text:'安德森(测试角色)',attr:{value:'fa862fad-5eef-4236-81e7-14fca5a69e27',name:'txtAccountID',accountName:'安德森'}},{id:'4419d9ea-cea3-4786-b9f5-3dc2fc2f6200',pid:'934cec74-5818-40ad-9c0b-cf7659936a76',text:'矮冬瓜(测试角色)',attr:{value:'4419d9ea-cea3-4786-b9f5-3dc2fc2f6200',name:'txtAccountID',accountName:'矮冬瓜'}},{id:'f1c7476f-5323-49e6-afa9-c3ded112b30f',pid:'934cec74-5818-40ad-9c0b-cf7659936a76',text:'阿道夫(测试角色)',attr:{value:'f1c7476f-5323-49e6-afa9-c3ded112b30f',name:'txtAccountID',accountName:'阿道夫'}},{id:'783ca418-c784-432a-9409-545d904fddcc',pid:'b5987497-8560-4a0b-bb19-decb55b29058',text:'小林1(测试角色)',attr:{value:'783ca418-c784-432a-9409-545d904fd9cc',name:'txtAccountID',accountName:'小林1'}},{id:'783ca418-c784-432a-9409-545d904fdddd',pid:'f1c7476f-5323-49e6-afa9-c3ded112b30f',text:'小林2(测试角色)',attr:{value:'783ca418-c784-432a-9409-545d904fd9cc',name:'txtAccountID',accountName:'小林1'}}];


		$("#radioTree").treeview({
			type:"radio",							//类型，默认情况下是文字，值分别有：normal/checkbox/radio
		    collapsed: false,						//是否默认收紧，true为收紧，false为展开
		    unique: false,							//是否只允许打开一个一级节点，true为是，false为否
			radioCallBack: function(treeNode){		//点击radio时的回调函数
					//console.log(treeNode);			//treeNode当前点击的radio或checkbox的JQ对象
			},
			json: data.slice(0)
	    });
	   $("#checkboxTree").treeview({
			type:"checkbox",							//类型，默认情况下是文字，值分别有：normal/checkbox/radio
		    collapsed: false,						//是否默认收紧，true为收紧，false为展开
		    unique: false,							//是否只允许打开一个一级节点，true为是，false为否
			
			nodeCallBack: function(treeNode){
				console.log(treeNode);
			},
			checkboxCallBack: function(treeNode){		//点击radio时的回调函数
				alert('checkbox');//treeNode当前点击的radio或checkbox的JQ对象
			},
			json:data.slice(0)
	    });
	    /*$("#normalTree").treeview({
			type:"normal",							//类型，默认情况下是文字，值分别有：normal/checkbox/radio
		    collapsed: false,						//是否默认收紧，true为收紧，false为展开
		    unique: false,							//是否只允许打开一个一级节点，true为是，false为否
			json:data.slice(0)
	    });*/
	    
	    
	    
	    
	</script>
	
</body>
</html>